import request from "@/utils/request";
import { ArtVideoQuery, ArtVideoPageResult, ArtVideoForm, ArtVideo } from "./model";

/**
 * 板块分类API
 */
class ArtVideoAPI {

  /**
   * 板块内容分类分页数据
   * @param queryParams 
   * @returns 
   */
  static getPage(queryParams?: ArtVideoQuery) {
    return request<any, ArtVideoPageResult>({
      url:
        "/artVideo/getPage?currentPage=" +
        queryParams?.pageNum +
        "&size=" +
        queryParams?.pageSize,
      method: "post",
      data: queryParams,
    });
  }

  /**
   * 获取板块分类列表
   * @param data 
   * @returns 
   */
  static getList(data: ArtVideoQuery) {
    return request<any, ArtVideo[]>({
      url: "/artVideo/getList",
      method: "post",
      data: data,
    });
  }


  /**
   * 新增板块分类
   * @param data 
   * @returns 
   */
  static add(data: ArtVideoForm) {
    return request({
      url: "/artVideo/add",
      method: "post",
      data: data,
    });
  }
  /**
   * 修改板块分类
   * @param data 
   * @returns 
   */
  static update(data: ArtVideoForm) {
    return request({
      url: "/artVideo/edit",
      method: "post",
      data: data,
    });
  }

  /**
   * 删除板块分类
   * @param data 
   * @returns 
   */
  static delete(data: ArtVideoForm) {
    return request({
      url: "/artVideo/delete",
      method: "post",
      data: data,
    });
  }
}

export default ArtVideoAPI;
